﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="MenuD.aspx.cs" Inherits="Manager_Menu_MenuD"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
        <tr>
            <td align="right" style="height: 16px">
                <asp:Button ID="btnGrpUser" runat="server" CssClass="cssButton" 
                                Text="Quản lý người dùng menu" OnClick="btnGrpUser_Click"  Visible="false"/>&nbsp;
                <asp:Button ID="btnAddGroupMn" runat="server" CssClass="cssButton" 
                                Text="Quản lý nhóm  menu" OnClick="btnAddGroupMn_Click"  Visible="false"/></td>
        </tr>
       
        <tr>
            <td style="height: 14px">
                <asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="View1" runat="server">
                <table border="1" bordercolor="#407db3" cellpadding="2" cellspacing="2" class="tbl_Comon-Search"
                    style="margin-left: 0px; width: 100%; border-collapse: collapse" width="100%">
                    <tr>
                        <td align="center" nowrap="nowrap" rowspan="2" style="width: 87px" valign="middle">
                            <asp:Button ID="btnSearch" runat="server" CssClass="cssButton" OnClick="btnSearch_Click"
                                Text="Tìm kiếm" Width="80px" /></td>
                        <td class="td_Title" nowrap="nowrap" rowspan="1" style="width: 109px">
                            <asp:Label ID="Label1" runat="server" CssClass="lbl_Common-Search" Text="Họ tên"></asp:Label></td>
                        <td class="td_Control" nowrap="nowrap" rowspan="1">
                            <asp:TextBox ID="txtName" runat="server" Height="20px" Width="98%"></asp:TextBox></td>
                        <td class="td_Title" nowrap="nowrap" style="width: 80px">
                            <asp:Label ID="Label2" runat="server" CssClass="lbl_Common-Search" Text="Quyền hạn"></asp:Label></td>
                        <td class="td_Control" nowrap="nowrap" style="width: 102px">
                            <asp:DropDownList ID="ddlChuDe" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlChuDe_SelectedIndexChanged">
                            </asp:DropDownList></td>
                    </tr>
                    <tr>
                        <td class="td_Title" nowrap="nowrap" rowspan="1" style="width: 109px">
                            <asp:Label ID="Label3" runat="server" CssClass="lbl_Common-Search" Text="Tên đăng nhập"></asp:Label></td>
                        <td class="td_Control" nowrap="nowrap" rowspan="1">
                            <asp:TextBox ID="txtLogin" runat="server" Height="20px" Width="98%"></asp:TextBox></td>
                        <td class="td_Title" nowrap="nowrap" style="width: 80px">
                            <asp:Label ID="Label4" runat="server" CssClass="lbl_Common-Search" Text="Email"></asp:Label></td>
                        <td class="td_Control" nowrap="nowrap">
                            <asp:TextBox ID="txtEmail" runat="server" Height="20px" Width="97%"></asp:TextBox></td>
                    </tr>
                </table>
                        <br />
                       <asp:GridView ID="grv_MasterUser" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                        BorderColor="#407DB3" BorderWidth="1px" CellPadding="2" DataKeyNames="UserID"
                                         PageSize="20" Width="100%" OnRowDataBound="grv_MasterUser_RowDataBound" OnPageIndexChanging="grv_MasterUser_PageIndexChanging">
                                               <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Họ tên
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("CusNm") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="cssBorderGrv" Width="40%" />
                                <HeaderStyle CssClass="cssBorderGrv" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Tên đăng nhập
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label55" runat="server" Text='<%# Eval("UserNm") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="cssBorderGrv" Width="25%" />
                                <HeaderStyle CssClass="cssBorderGrv" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Email
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="cssBorderGrv" Width="15%" />
                                <HeaderStyle CssClass="cssBorderGrv" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Quyền hạn
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblsex" runat="server" Text='<%# Eval("AutNm") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Width="15%" />
                                <HeaderStyle CssClass="cssBorderGrv" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <img src='../../Images/Icon/menuicon.png' border=0 alt='Quản lý menu'  width='20px' height='20px' style="cursor:pointer"  onclick='fnViewMenuDetal(this,<%# Eval("UserID") %>,<%# Eval("AutID") %>)' UserNm='<%# Eval("UserNm") %>'>
                                </ItemTemplate>
                                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" />
                                <HeaderStyle CssClass="cssBorderGrv" />
                            </asp:TemplateField>
                        </Columns>
                                        <RowStyle CssClass="gvRowStyle" />
                                        <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
                                        <HeaderStyle CssClass="gvHeader" />
                                    </asp:GridView>
                    </asp:View>
                    <asp:View ID="View2" runat="server">
                    
                    <table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td align="left">
<TABLE style="BORDER-COLLAPSE: collapse" borderColor="#407db3" cellSpacing="2" cellPadding="2"
				width="100%"  border="1" class="tbl_Comon-Search">
        <tr>
            <td class="td_Control" nowrap="nowrap" style="text-align: center; width: 89px;" align="center">
                <asp:Button ID="Button1" runat="server" Text="Tìm kiếm" CssClass="cssButton" OnClick="Button1_Click" /></td>
            <td nowrap class="td_Title" style="width: 86px">
                <asp:Label ID="Label6" runat="server" Text="Quyền hạn" CssClass="lbl_Common-Search"></asp:Label></td>
            <td align="left" class="td_Control">
                <asp:TextBox ID="txtQuyenHan" runat="server" Width="98%"></asp:TextBox>
            </td>
        </tr>
    </table>
</td>
</tr>
<tr>
    <td>
                    <asp:GridView ID="grv_MasterAuthority" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                        BorderColor="#407DB3" BorderWidth="1px" CellPadding="2" 
                                         PageSize="20" Width="100%" OnPageIndexChanging="grv_MasterAuthority_PageIndexChanging">
                                          <Columns>
                
                                             <asp:TemplateField>
                                            <HeaderTemplate>
                                            Quyền hạn
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                              <asp:Label ID="Label1" runat="server" Text='<%# Eval("AutNm") %>'></asp:Label>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtETenMn" runat="server"  Text='<%# Eval("AutNm") %>' Width="95%"></asp:TextBox>
                                            </EditItemTemplate>
                                                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Width="95%" />
                                                <HeaderStyle CssClass="cssBorderGrv"  HorizontalAlign="Left"/>
                                            </asp:TemplateField>
                                             <asp:TemplateField>
                                                <ItemTemplate>
                                                   
                                                   <img src='../../Images/Icon/menuicon.png' border=0 alt='Quản lý menu'  width='20px' height='20px' style="cursor:pointer"  onclick='fnViewMenuDetal(this,"",<%# Eval("AutID") %>)' AutNm='<%# Eval("AutNm") %>'>
                                                </ItemTemplate>
                                                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" />
                                                <HeaderStyle CssClass="cssBorderGrv" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <RowStyle CssClass="gvRowStyle" />
                                        <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
                                        <HeaderStyle CssClass="gvHeader" />
                 
                        <RowStyle CssClass="gvRowStyle" />
                        <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
                        <HeaderStyle CssClass="gvHeader" />
                    </asp:GridView>
                    </td></tr></table>
                    </asp:View>
                </asp:MultiView>
                
                
                </td>
        </tr>
    </table>
    <br />
    <script language="javascript" type="text/javascript">
    function fnViewMenuDetal(obj,UserID,AutID)
    {
       
        if(UserID!="")
        {
            var CodeID='<%= Request.QueryString["CodeID"]%>';
            var UserNm=obj.getAttribute("UserNm");
            window.location.href="AddMenuD.aspx?index=0&CodeID="+CodeID+"&UserNm="+UserNm+"&AutID="+AutID+"&UserID="+UserID;
        }
        else
        {
            var CodeID='<%= Request.QueryString["CodeID"]%>';
            var AutNm=obj.getAttribute("AutNm");
            window.location.href="AddMenuD.aspx?index=1&CodeID="+CodeID+"&AutNm="+AutNm+"&AutID="+AutID;
        }
    }
    </script>
</asp:Content>

